{% if pager.total_pages > 1 %}
    <p class="pager">

    <!-- Previous link -->
    {% if pager.current_page > 1 %}
        {% set pre_page as pager.current_page - 1 %}
        <a href="{% url router with ['page': pre_page] %}">Previous</a>
    {% else %}
        <span class="disabled">Previous</span>
    {% endif %}

    <!-- Page bar -->
    {% for i in pager.page_start .. pager.page_end %}
        {% if pager.current_page == i %}
        <span class="current">{{ i }}</span>
        {% else %}
        <a href="{% url router with ['page': i] %}">{{ i }}</a>
        {% endif %}
    {% endfor %}

    <!-- Next link -->
    {% if pager.current_page < pager.total_pages %}
        {% set next_page as pager.current_page + 1 %}
        <a href="{% url router with ['page': next_page] %}">Next</a>
    {% else %}
        <span class="disabled">Next</span>
    {% endif %}

    </p>
{% endif %}
